<?php
$this->breadcrumbs = array(
    'All Users' => array('users/index'),
    $user->name => array('users/view', 'id' => $user->id),
    'Edit User'
);
?>
<script type="text/javascript">
    var userId = <?php echo $user->id; ?>;
    var selectedOverride;
</script>
<?php $this->renderPartial('_tabs', array('user' => $user)); ?>
<div class="grid_16">
    <div id="edit-profile" class="section">
        <div class="block">
            <h2>
                <img src="/images/icons/farmfresh/32x32/award_star_bronze_1.png" />
                Training Information
            </h2>
            <?php
            $form = $this->beginWidget('CActiveForm', array(
                'id' => 'user-form',
                'enableAjaxValidation' => FALSE,
            ));
            ?>
            <table class="form-table">
                <tr>
                    <th scope="row" width="150" class="align-right">
                        <?php echo $form->labelEx($user, 'training_mode', array('label' => 'Training Mode')); ?>
                    </th>
                    <td>
                        <?php echo $form->dropDownList($user, 'training_mode', User::getTrainingModeListData(), array('prompt' => "")); ?>
                        <?php echo $form->error($user, 'training_mode'); ?>
                    </td>
                </tr>
            </table>
            <div class="row buttons">
                <div class="cell">
                    <?php echo CHtml::submitButton('Save Changes', array('class' => 'no-margin green')); ?>
                </div>
            </div>
        </div>
        <?php $this->endWidget(); ?>
    </div>
</div>

<div class="grid_16">
    <div id="user-info" class="section">
        <div class="block">
            <div class="form">
                <h2>Training Record History</h2>
                <?php
                $this->widget('PsGridView', array(
                    'dataProvider' => $trainingRecordsDataProvider,
                    'template' => '{items}{pager}',
                    'pagerCssClass' => 'pager float-right',
                    'htmlOptions' => array(
                        'class' => 'grid-view no-shadow'
                    ),
                    'rowCssClassExpression' => '($row % 2 == 0 ? "even" : "odd")',
                    'columns' => array(
                        'start_time' => array(
                            'name' => 'start_time',
                            'value' => '($data->start_time)?$data->start_time:"-"',
                            'headerHtmlOptions' => array(
                                'width' => 100,
                            ),
                        ),
                        'end_time' => array(
                            'name' => 'end_time',
                            'value' => '($data->end_time)?$data->end_time:"-"',
                            'headerHtmlOptions' => array(
                                'width' => 100,
                            ),
                        ),
                        'status' => array(
                            'name' => 'status',
                            'value' => '($data->status == 1)?"ON":"OFF"',
                        ),
                    )
                ));
                ?>
            </div>
        </div>
    </div>
</div>